<?php
class Article extends DomArDomainObject {
	
	private static $mapper;
	
	public function getMapper( ) {
		if( self::$mapper == NULL ) {
			$mapper = ArticleMapper::getInstance();
		}
		return $mapper;
	}
	
}

class SpecialArticle extends Article {
	
	private static $mapper;
	
	public function getMapper( ) {
		if( self::$mapper == NULL ) {
			$mapper = SpecialArticleMapper::getInstance();
		}
		return $mapper;
	}
	
	
}

class ArticleMapper extends DomArMapper {
	
	public function __construct() {
		$this->properties['title'] = new DomArProperty( $this, 'title');
		$this->properties['contents'] = new DomArProperty( $this, 'contents');
	}
	
	public function prepareProperties() {
		
	}
	
	
}

class SpecialArticleMapper extends DomArMapper {
	
	private $instance;
	
	public function getInstance() {
		if( self::$instance == NULL ) {
			self::$instance = new SpecialArticleMapper();
			self::$instance->preparePoperties();
		}
		return self::$instance;
	}
	
	public function __construct() {
		$this->parentMapper = ArticleMapper::getInstance();
		$this->properties['special'] = new DomArProperty( $this, 'special');
	}
	
	public function prepareProperties() {
		
	}
	
	
}



DomArSession::newCurrent();

$a = new A();
$a->title = 'haha';
$a->contents = 'hello world!';

if( DomArSession()->commit() ) {
	// cool
} else {
	$errors = DomArSession()->validationErrors;
}









?>